package com.edu.edumanager.mapper;

import com.edu.edumanager.bean.EduTeacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EduTeacherMapper {
    /**
     * 根据讲师id 逻辑删除讲师
     * @param  ids 讲师id数组
     * @return 成功条数
     */
    int deleteTeacher(@Param("ids") List<Integer> ids);

    /**
     * 根据讲师id查询讲师信息
     * @param teacherId 讲师id
     * @return 返回指定讲师对象
     */
    EduTeacher findTeacher(Integer teacherId);

    /**
     * 添加讲师
     * @param teacher 讲师对象
     * @return 执行条数
     */
    int addTeacher(EduTeacher teacher);
    /**
     * 修改讲师
     * @param eduTeacher 讲师对象
     * @return 执行条数
     */
    int updateTeacher(EduTeacher eduTeacher);

    /**
     * 分页查询+多条件
     * @param index
     * @param limit
     * @param teacher
     * @return
     */
    List<EduTeacher> pageQuery(@Param("index") int index,@Param("limit") Integer limit,@Param("teacher") EduTeacher teacher);

    int conditionsTotal(@Param("teacher") EduTeacher teacher);

    /**
     * 查询所有讲师
     * @return
     */
    List<EduTeacher> findTeacherAll();
}